import React from 'react'
import Child from './Child.js'
import { Button } from 'antd'
// import {Button} from 'antd'
import 'antd/dist/antd.css'



export default class Life extends React.Component{
    
  constructor(props){
        super(props);
        this.state = {
            count:0
        };
    }
    handAdd = ()=>{
        this.setState({
            count:this.state.count+1
        })
    }

    handClick(){
        this.setState({
            count:this.state.count+1
        })

    }

    
    render(){
        var style = {
            padding:100
        }

        return <div style={style}>
            <p>React生命周期介绍</p>
            <Button onClick = {this.handAdd} type="primary">antD点击一下</Button>
            <button onClick = {this.handAdd}>点击一下</button>
            <button onClick = {this.handClick.bind(this)}>点击一下</button>
            <p>{this.state.count}</p>
            <Child name ="jack"></Child>
        </div>

    }

}